/****************************************************************
** Tutorial_Arduino_Basic_BlinkM_Control                
**
** Original Author:      Sammy_K
** Webpage:              www.dreamgineer.org
**
** Project:              Dreamgineer Tutorials: Arduino
** Written On:           June 2012
** Last Updated:         June 2012
**
** A Simple Example That Demonstrates How To Use I2C Functions To
** Control A BlinkM 'Smart-LED'.
**
****************************************************************/

/****************************************************************
** Includes
**
** Include Wire.h for I2C Support
****************************************************************/
#include <Wire.h>

/****************************************************************
** setup() - Executes Once On Boot
**
** Join I2C Bus As Master Device
**
****************************************************************/
void setup()
{
  Wire.begin();  //Join The I2C Bus As Master
}

/****************************************************************
** loop() - Executes Repeatadly After setup() returns.
**
** Start I2C Transmission, Send 4 Byte Command, End Transmission
**
****************************************************************/
void loop()
{
  // Begin I2C Transmission With General Call Address (0)
  Wire.beginTransmission(0x00); 
  Wire.write(0x6E);        // Send BlinkM Go to RGB Color Now Command Byte
  Wire.write(0x00);        // Send Red Value
  Wire.write(0xFF);        // Send Green Value
  Wire.write(0x00);        // Send Blue Value
  Wire.endTransmission();  // End The I2C Transmission  
}

/****************************************************************
** Copyright (c) Dreamgineer.org
**
** Permission to use, copy, modify, and distribute this software 
** for any purpose with or without fee is hereby granted, 
** provided that the above copyright notice and this permission 
** notice appear in all copies. 
**
** THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 
** WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 
** WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL 
** THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
** CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
** FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF 
** CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
** OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
****************************************************************/
